Skip to content

[NixIO] Proper handling of multiple references to the same object#352

Merged
apdavison merged 14 commits intoNeuralEnsemble:masterfrom
G-Node:multiref-write
Sep 9, 2017
Merged

[NixIO] Proper handling of multiple references to the same object#352
apdavison merged 14 commits intoNeuralEnsemble:masterfrom
G-Node:multiref-write

Conversation

@achilleas-k
Copy link
Contributor

@achilleas-k achilleas-k commented Jun 22, 2017

Currently, the NixIO does not properly handle cases where the same Neo object is attached to multiple locations. For instance, if an AnalogSignal is attached to multiple Segments, the NixIO will fail on write while attempting to create the same object a second time.

With this PR the IO now detects such cases and mirrors the references between Neo objects as closely as possible in the NIX file (e.g., the DataArray created from the AnalogSignal in the above example will be attached to multiple Groups).

An IO test has been added for this behaviour (test_multiref_write).

The issue was first described in #311 (comment). Since the new naming scheme was already merged and the problem mentioned in the issue is fixed, this PR closes #311.

Similar to adding multiple links to the same AnalogSignal.
Sometimes an object may already be stored in the nix file but not at
every location it should be. Until now, if an object was found to be
already in the nix file, no operation would take place.

We need to check for the case where the object is stored in the file
but is not linked to the location we're currently looking at (e.g., a
DataArray might have to be linked to multiple groups).
Tests classes are skipped conditionally instead
The IO would keep track of object mappings from Neo object ids to NIX
objects and vice versa. We now use the same key to track both kinds of
objects in two different maps: one for Neo and one for Neo and one for
NIX objects.
Class methods are not skipped when module is missing (by the unittest
decorator), so we need the checks to avoid failing when there is no NIX
module.
@coveralls
Copy link

coveralls commented Jun 29, 2017

Coverage Status

Coverage increased (+0.1%) to 50.029% when pulling 276d3a2 on G-Node:multiref-write into 8997ad2 on NeuralEnsemble:master.

@achilleas-k
Copy link
Contributor Author

I have fixed the issue reported in #356. Should I push it to this PR or open a new one to keep things cleaner?

@apdavison
Copy link
Member

Whichever you think is best

@achilleas-k
Copy link
Contributor Author

achilleas-k commented Jun 30, 2017

I'll push the fix here, then. Thanks.

The new commits fix reading and writing for channel_ids and add tests for the property.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.05%) to 49.983% when pulling 257f339 on G-Node:multiref-write into 8997ad2 on NeuralEnsemble:master.

@coveralls
Copy link

coveralls commented Jun 30, 2017

Coverage Status

Coverage increased (+0.06%) to 49.988% when pulling 257f339 on G-Node:multiref-write into 8997ad2 on NeuralEnsemble:master.

@samuelgarcia samuelgarcia added this to the 0.5.2 milestone Aug 23, 2017
@apdavison apdavison merged commit fb56727 into NeuralEnsemble:master Sep 9, 2017
@achilleas-k achilleas-k deleted the multiref-write branch September 10, 2017 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[NixIO] Object names, writing, and overwriting

4 participants